public class DefineMethod_Text01 {
    /* main函数 */
    public static void main(String[] args) {
        System.out.println(isEqual(20,20));
        System.out.println(sum(1,5));
    }
    /*  问题1：判断两个数是否相同 */
    public static Boolean isEqual(int a,int b){
//        if (a == b){
//            return true;
//        }else{
//            return false;
//        }
         return a == b;
    }
    
    /* 问题2 求出两个整数之间的和 */
    public static int sum(int a, int b){
        if (a<=b){
            a = a;
            b = b;
        }else {
            int c = a;
            a = b;
            b = c;
        }

        int sum = a - 1;
        for (int i = a; i <= b; i++) {
            sum = i + sum;
        }

        return sum;
    }
    
}
